<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common/taglibs.jsp"%>
<!-- 
    Copyright (C)  2011  chen wei hua.
    Permission is granted to copy, distribute and/or modify this document
    under the terms of the GNU Free Documentation License, Version 2.0
    or any later version published by the Free Software Foundation;
    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
    A copy of the license is included in the section entitled "GNU Free Documentation License".
 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>异常统计</title>
<%@ include file="../common/config.jsp"%>
<%@ include file="../common/report.jsp"%>
		<script type="text/javascript">
			var chart;
			$(document).ready(function() {
				chart = new Highcharts.Chart({
					chart: {
						renderTo: 'displayChart',
						plotBackgroundColor: null,
						plotBorderWidth: null,
						plotShadow: false
					},
					credits: {
						enabled: false
					},
					title: {
						text: '按部门统计异常分布图'
					},
					tooltip: {
						formatter: function() {
							return '<b>'+ this.point.name +'</b>: '+ this.y +' %';
						}
					},
					plotOptions: {
						pie: {
							allowPointSelect: true,
							cursor: 'pointer',
							dataLabels: {
								enabled: true,
								color: '#000000',
								connectorColor: '#000000',
								formatter: function() {
									return '<b>'+ this.point.name +'</b>: '+ this.y +' %';
								}
							}
						}
					},
				    series: [{
						type: 'pie',
						name: '部门异常',
						data: <s:property value="pieDataJSON" escape="false" />
					}]
				});
			});
		</script>
</head>
<body>
    <div class="subnav" align="left">
           <table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="100%" align="left" height="31">&nbsp;<img src="images/title-pk.gif" border="0"  align="absmiddle"/>&nbsp;<span class="subnavtxt1">统计报表</span>
			&nbsp;<img src="images/leftico2.gif" border="0"  align="absmiddle"/>&nbsp;<span class="subnavtxt2">异常统计</span></td>
		  </tr>
		</table>
      </div>
<s:actionerror cssStyle="color:red"/>
<div class="main_1">
<s:form action="reasonReport">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  	<td width="10%" align="right"></td>
  	<td width="60%">
  		<s:radio list='#{"1":"本月", "2":"上月"}' name="queryDateType" />
  	</td>
    <td width="30%" align="left">
        <s:submit value="查询" cssClass="input1" />
    </td>
  </tr>
  </table>
</s:form>
</div>
<div class="main_1">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  	<td width="70%">
  	  <div id="displayChart" style="width: 600px; height: 400px; margin: 0 auto" />
  	</td>
    <td width="30%">
      <div style="width: 200px; height: 400px; margin: 0 auto">
      <table width="100%" cellpadding="0" cellspacing="1" border="0" class="ksglxx2a">
        <tr class="ksglxx2bg">
           <th width="30%" align="left">部门</th>
           <th width="30%" align="left">异常数</th>
           <th width="40%" align="left">百分比(%)</th>
        </tr>
        <s:iterator value="reportDatas" id="data" status="st">
          <s:if test="#st.Odd">
            <tr class="odd">
              <td><s:property value="#data.column" /></td>
              <td><s:property value="#data.data" /></td>
              <td><s:property value="#data.precent" /></td>
            </tr>
          </s:if>
          <s:else>
            <tr class="even">
              <td><s:property value="#data.column" /></td>
              <td><s:property value="#data.data" /></td>
              <td><s:property value="#data.precent" /></td>
            </tr>
           </s:else>
         </s:iterator> 
       </table>
       </div>
    </td>
  </tr>
</table>
</div>
</body>
</html>
